﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Kryptonalysis.BletchleyPark
{
    /// <summary>
    /// Class to hold distances between a group of letters.
    /// </summary>
    public class StringDistances
    {
        private string _Letters;
        /// <summary>
        /// Gets or sets the letters.
        /// </summary>
        /// <value>The letters.</value>
        public string Letters
        {
            get { return _Letters; }
            set
            {
                _Letters = value;
            }
        }

        private List<int> _Distances;
        /// <summary>
        /// Gets or sets the distances.
        /// </summary>
        /// <value>The distances.</value>
        public List<int> Distances
        {
            get { return _Distances; }
            set { _Distances = value; }
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="StringDistances"/> class.
        /// </summary>
        public StringDistances()
        {
            _Distances = new List<int>();
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="StringDistances"/> class.
        /// </summary>
        /// <param name="letters">The letters.</param>
        /// <param name="dists">The dists.</param>
        public StringDistances(string letters, List<int> dists)
        {
            _Letters = letters;
            _Distances = dists;
        }

        /// <summary>
        /// Returns a <see cref="System.String"/> that represents this instance.
        /// </summary>
        /// <returns>
        /// A <see cref="System.String"/> that represents this instance.
        /// </returns>
        public string ToString()
        {
            string result = _Letters + ": ";
            foreach (int item in _Distances)
            	result += item + "\t";
            return result;
        }
    }
}
